package com.cungmua.app.model.request;

import com.cungmua.app.utils.AppUtils;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by kelvin.nguyen on 7/21/14.
 */
public class OrderHistoryRequest extends AuthenticatedRequest {

    private int userId;
    private int version;
    private int page;


    public OrderHistoryRequest(String deviceId, String token) {
        super(deviceId, token);
    }

    public int getUserId() {
        return userId;
    }

    public int getPage() {
        return page;
    }

    public int getVersion() {
        return version;
    }

    @JsonProperty("UserId")
    public void setUserId(int userId) {
        this.userId = userId;
    }

    @JsonProperty("PageIndex")
    public void setPage(int page) {
        this.page = page;
    }

    @JsonProperty("Version")
    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String getSign() {

        return AppUtils.MD5(String.valueOf(getUserId())  + getPage() +
                getVersion() + getDeviceId() + getToken());
    }
}
